$OpenBSD: patch-lib_Video_DVDRip_GUI_Project_Title_pm,v 1.1 2013/04/06 18:36:21 stsp Exp $
Fix DVD drive close/eject buttons.
--- lib/Video/DVDRip/GUI/Project/Title.pm.orig	Sat Feb 28 19:27:59 2009
+++ lib/Video/DVDRip/GUI/Project/Title.pm	Fri Apr  5 18:42:11 2013
@@ -431,12 +431,10 @@ sub view_title {
 sub eject_dvd {
     my $self = shift;
 
-    my $title = $self->selected_title;
+    my $dev = $self->project->dvd_device;
+    $dev =~ s/^\/dev\/(cd[0-9])[a-p]/\1/;
+    my $command = $self->config('eject_command') . " " . $dev;
 
-    my $command
-        = $self->config('eject_command') . " " .
-            $title->project->dvd_device;
-
     system("$command &");
 
     1;
@@ -445,10 +443,9 @@ sub eject_dvd {
 sub insert_dvd {
     my $self = shift;
 
-    my $title = $self->selected_title;
-
-    my $command = $self->config('eject_command') . " -t "
-        . $title->project->dvd_device;
+    my $dev = $self->project->dvd_device;
+    $dev =~ s/^\/dev\/(cd[0-9])[a-p]/\1/;
+    my $command = $self->config('eject_command') . " -t " . $dev;
 
     system("$command &");
 
